<?php
defined('PHPFOX') or exit('NO DICE!');
/**
 * @author  		Miguel Espinoza (Purefan)
 */
class Iaip1_Service_Process extends Phpfox_Service 
{
	/**
	 * Class constructor
	 */	
	public function __construct()
	{	
		
	}
	
	
	/**
	 * @param array $aUsers JSON object
	 */
	public function deleteUsers($sUsers)
	{
		Phpfox::isAdmin(true);
		Phpfox::getUserParam('admincp.has_admin_access', true);
		
		$aIds = json_decode($sUsers, true);
		if (!is_array($aIds))
		{
			return Phpfox_Error::set(Phpfox::getPhrase('iaip1.param_is_not_an_array'));
		}
		
		foreach ($aIds as $iId)
		{
			Phpfox::massCallback('onDeleteUser', $iId);
		}
		return true;
	}
	
	/**
	 * If a call is made to an unknown method attempt to connect
	 * it to a specific plug-in with the same name thus allowing 
	 * plug-in developers the ability to extend classes.
	 *
	 * @param string $sMethod is the name of the method
	 * @param array $aArguments is the array of arguments of being passed
	 */
	public function __call($sMethod, $aArguments)
	{			
		/**
		 * No method or plug-in found we must throw a error.
		 */
		Phpfox_Error::trigger('Call to undefined method ' . __CLASS__ . '::' . $sMethod . '()', E_USER_ERROR);
	}	
}

?>
